home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / howtoo1r / main.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-08-27  |  6.2 KB  |  200 lines

  1. VERSION 5.00
  2. Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
  3. Begin VB.Form main 
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "Server Demo - By Pirotic"
  6.    ClientHeight    =   3165
  7.    ClientLeft      =   45
  8.    ClientTop       =   615
  9.    ClientWidth     =   9750
  10.    Icon            =   "main.frx":0000
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    ScaleHeight     =   3165
  14.    ScaleWidth      =   9750
  15.    StartUpPosition =   2  'CenterScreen
  16.    Begin MSWinsockLib.Winsock sock 
  17.       Index           =   0
  18.       Left            =   9240
  19.       Tag             =   "0"
  20.       Top             =   2760
  21.       _ExtentX        =   741
  22.       _ExtentY        =   741
  23.       _Version        =   393216
  24.    End
  25.    Begin MSWinsockLib.Winsock disallow 
  26.       Left            =   8640
  27.       Top             =   2760
  28.       _ExtentX        =   741
  29.       _ExtentY        =   741
  30.       _Version        =   393216
  31.    End
  32.    Begin VB.Frame Frame1 
  33.       Caption         =   " Information "
  34.       Height          =   2775
  35.       Left            =   120
  36.       TabIndex        =   1
  37.       Top             =   120
  38.       Width           =   2055
  39.       Begin VB.CommandButton advanced 
  40.          Caption         =   "Client Information"
  41.          Height          =   375
  42.          Left            =   120
  43.          TabIndex        =   6
  44.          Top             =   2280
  45.          Width           =   1815
  46.       End
  47.       Begin VB.Label live_connections_info 
  48.          Caption         =   "N/A"
  49.          Height          =   255
  50.          Left            =   120
  51.          TabIndex        =   5
  52.          Top             =   1080
  53.          Width           =   1815
  54.       End
  55.       Begin VB.Label Label2 
  56.          AutoSize        =   -1  'True
  57.          Caption         =   "Clients Connected :"
  58.          BeginProperty Font 
  59.             Name            =   "MS Sans Serif"
  60.             Size            =   8.25
  61.             Charset         =   0
  62.             Weight          =   700
  63.             Underline       =   0   'False
  64.             Italic          =   0   'False
  65.             Strikethrough   =   0   'False
  66.          EndProperty
  67.          Height          =   195
  68.          Left            =   120
  69.          TabIndex        =   4
  70.          Top             =   840
  71.          Width           =   1680
  72.       End
  73.       Begin VB.Label sockets_loaded_info 
  74.          Caption         =   "N/A"
  75.          Height          =   255
  76.          Left            =   120
  77.          TabIndex        =   3
  78.          Top             =   600
  79.          Width           =   1815
  80.       End
  81.       Begin VB.Label Label1 
  82.          AutoSize        =   -1  'True
  83.          Caption         =   "Sockets Loaded :"
  84.          BeginProperty Font 
  85.             Name            =   "MS Sans Serif"
  86.             Size            =   8.25
  87.             Charset         =   0
  88.             Weight          =   700
  89.             Underline       =   0   'False
  90.             Italic          =   0   'False
  91.             Strikethrough   =   0   'False
  92.          EndProperty
  93.          Height          =   195
  94.          Left            =   120
  95.          TabIndex        =   2
  96.          Top             =   360
  97.          Width           =   1515
  98.       End
  99.    End
  100.    Begin VB.ListBox status 
  101.       BackColor       =   &H00FFFFFF&
  102.       BeginProperty Font 
  103.          Name            =   "Arial"
  104.          Size            =   9.75
  105.          Charset         =   0
  106.          Weight          =   400
  107.          Underline       =   0   'False
  108.          Italic          =   0   'False
  109.          Strikethrough   =   0   'False
  110.       EndProperty
  111.       Height          =   2700
  112.       Left            =   2280
  113.       TabIndex        =   0
  114.       TabStop         =   0   'False
  115.       Top             =   120
  116.       Width           =   7335
  117.    End
  118.    Begin VB.Menu servertab 
  119.       Caption         =   "Server"
  120.       Begin VB.Menu settingstab 
  121.          Caption         =   "Settings"
  122.       End
  123.       Begin VB.Menu tabthang 
  124.          Caption         =   "-"
  125.       End
  126.       Begin VB.Menu reset_server_tab 
  127.          Caption         =   "Reset"
  128.       End
  129.       Begin VB.Menu tabthing 
  130.          Caption         =   "-"
  131.       End
  132.       Begin VB.Menu shutdown_server 
  133.          Caption         =   "Exit"
  134.       End
  135.    End
  136.    Begin VB.Menu debugtab 
  137.       Caption         =   "Debug"
  138.       Begin VB.Menu start_telnet 
  139.          Caption         =   "TelNet Connect"
  140.       End
  141.    End
  142. Attribute VB_Name = "main"
  143. Attribute VB_GlobalNameSpace = False
  144. Attribute VB_Creatable = False
  145. Attribute VB_PredeclaredId = True
  146. Attribute VB_Exposed = False
  147. Private Sub advanced_Click()
  148. wininfo.Show
  149. End Sub
  150. Private Sub Form_Load()
  151. 'start up the server
  152. start_server
  153. 'update info
  154. update_info
  155. End Sub
  156. Private Sub Form_Unload(Cancel As Integer)
  157. 'when the program ends, close all the sockets.
  158. close_all_sockets
  159. Unload wininfo
  160. Unload Me
  161. End Sub
  162. Private Sub reset_server_tab_Click()
  163. reset_server
  164. End Sub
  165. Private Sub settingstab_Click()
  166. 'show the settings window
  167. settings_window.Show
  168. End Sub
  169. Private Sub shutdown_server_Click()
  170. Unload Me
  171. End Sub
  172. Private Sub sock_Close(Index As Integer)
  173. 'Log out clients once they have quit
  174. logout_client Index, "Connection long"
  175. End Sub
  176. Private Sub sock_DataArrival(Index As Integer, ByVal bytesTotal As Long)
  177. 'incomming data,to recive it and send it to get decoded
  178. Dim new_data As String
  179. sock(Index).GetData new_data
  180. DoEvents
  181. decode_data new_data, Index
  182. End Sub
  183. Private Sub sock_Error(Index As Integer, ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
  184. 'Log out clients if error on port
  185. logout_client Index, "Error - " & Description
  186. End Sub
  187. Private Sub sock_ConnectionRequest(Index As Integer, ByVal requestid As Long)
  188. 'Login a new user on a connection request
  189. If Index = "0" Then
  190. 'show in status
  191. 'update_status ">> Incomming Connection Request <<"
  192. 'login new user
  193. new_connection requestid
  194. DoEvents
  195. End If
  196. End Sub
  197. Private Sub start_telnet_Click()
  198. AppActivate Shell("telnet 127.0.0.1 " & server_port, vbNormalNoFocus)
  199. End Sub
  200.